maintainer="Michał Polański <michal@polanski.me>"
pkgname=py3-faker
pkgver=30.8.2
pkgrel=0
pkgdesc="Python package that generates fake data for you"
url="https://faker.readthedocs.io/en/master"
license="MIT"
arch="noarch"
depends="py3-dateutil py3-typing-extensions"
makedepends="py3-gpep517 py3-setuptools py3-wheel"
checkdepends="py3-email-validator py3-ipaddress py3-mock py3-freezegun
	py3-more-itertools py3-pytest py3-ukpostcodeparser py3-validators
	py3-pytest-runner py3-random2 py3-pillow"
subpackages="$pkgname-pyc"
source="https://github.com/joke2k/faker/archive/v$pkgver/py3-faker-$pkgver.tar.gz"
builddir="$srcdir/faker-$pkgver"

replaces="py-faker" # Backwards compatibility
provides="py-faker=$pkgver-r$pkgrel" # Backwards compatibility

prepare() {
	default_prepare
	# tests erroneously require a specific version of pytest
	sed -i setup.py -e 's/ *"pytest>=.*//g'
}

build() {
	gpep517 build-wheel \
		--wheel-dir .dist \
		--output-fd 3 3>&1 >&2
}

check() {
	python3 -m venv --clear --without-pip --system-site-packages .testenv
	.testenv/bin/python3 -m installer .dist/*.whl
	.testenv/bin/python3 -m pytest
}

package() {
	python3 -m installer -d "$pkgdir" \
		.dist/*.whl
}

sha512sums="
5967660a3b218b56501368cce83a1897fa65dce1b08bb61ae09cabc50687e71cab381b5790aea6c3fbce9ec5248485ac9cf9edc9e9712f3efebe4c70e884e8e7  py3-faker-30.8.2.tar.gz
"
